package com.naishuo.bigevent.anno;

import com.naishuo.bigevent.validation.StateValidation;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Constraint(
        validatedBy = {StateValidation.class}
)
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)

public @interface State {

    String message() default "只能是草稿或已发布"; // 修改默认消息

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}